package com.ruoyi.system.mapper;

import com.ruoyi.common.core.domain.entity.SysDocument;
import com.ruoyi.common.core.domain.entity.SysDocumentCategory;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SysDocumentMapper {
    List<SysDocument> selectDocumentList(SysDocument document);
    int insertDocument(SysDocument document);
    int updateDocument(SysDocument document);
    int deleteDocumentByIds(Long[] documentIds);
    int deleteDocumentByPath(String filePath);

    /**
     * 根据名称删除file_info表数据
     * @param fileName
     * @return
     */
    int deleteFileByName(String fileName);
    SysDocument selectDocumentById(Long documentId);

    List<SysDocumentCategory> selectCategoryList(SysDocumentCategory category);
    int insertCategory(SysDocumentCategory category);
    int updateCategory(SysDocumentCategory category);
    int deleteCategoryById(Long categoryId);
    SysDocumentCategory selectCategoryById(Long categoryId);

    List<SysDocumentCategory> selectChildrenCategoryById(Long categoryId);
    int updateCategoryChildren(List<SysDocumentCategory> children);

    @Select("select * from sys_document_category")
    List<SysDocumentCategory> selectAllCategories();
}